/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package beans;

import java.util.Objects;

public class Beer {
    
    private Long id;
    private String name;
    private String mark;
    private Float alcoholicPercentage;
    private String description;
    private String image;

    public Long getId() {
        return id;
    }

//    public void setId(String id) {
//        setId(new Long(id));
//    }
    
    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getMark() {
        return mark;
    }

    public void setMark(String mark) {
        this.mark = mark;
    }

    public Float getAlcoholicPercentage() {
        return alcoholicPercentage;
    }
    
    public void setAlcoholicPercentage(String alcoholicPercentage){
        setAlcoholicPercentage(new Float(alcoholicPercentage));
    }

    public void setAlcoholicPercentage(Float alcoholicPercentage) {
        this.alcoholicPercentage = alcoholicPercentage;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }

    @Override
    public String toString() {
        return "Beer: id = " + id + "\n\r\tname = " + name + "\n\r\nmark = " + mark + "\n\r\nalcoholic percentage = " + 
                alcoholicPercentage + "\n\r\ndescription = " + description + "\n\r\nimage = " + image;
    }

    @Override
    public int hashCode() {
        int hash = 5;
        hash = 97 * hash + Objects.hashCode(this.id);
        hash = 97 * hash + Objects.hashCode(this.name);
        hash = 97 * hash + Objects.hashCode(this.mark);
        hash = 97 * hash + Objects.hashCode(this.alcoholicPercentage);
        hash = 97 * hash + Objects.hashCode(this.description);
        hash = 97 * hash + Objects.hashCode(this.image);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Beer other = (Beer) obj;
        if (!Objects.equals(this.id, other.id)) {
            return false;
        }
        return true;
    }
    
}
